home *** CD-ROM | disk | FTP | other *** search
Clarion Help | 1991-07-24 | 23.8 KB | 581 lines |
- Compiler Errors
- E @15/30: '.' WAS NOT EXPECTED HERE
- E @20/5:
- 'ALERS' IS NOT A PROCEDURE
- E @27/5:
- 'OR' IS INVALID IN THIS EXPRESSION
- E @27/5:
- 'OR' - OPERATOR CANNOT BEGIN A STATEMENT
- Press Esc to correct errors
- Press Enter to continue
- The CLARION Compiler
- Source File:C:\PHONES\PHONES.CLA
- Listing
- Yes No
- This is the Compiler tutorial. It should be
- viewed after the Designer tutorial.
- The Designer tutorial generated the source
- code for a phone directory application into
- seven modules: PHONES.CLA and PHONES1.CLA
- through PHONES6.CLA.
- PHONES.CLA is a program module. It contains
- a MAP structure that names the other source
- modules in the application.
- A program module also contains the global
- data for an application. Global data can be
- used by any procedure in any module. In our
- application, the PHONEBK file is global.
- PHONES1.CLA through PHONES6.CLA are member
- modules. Member modules contain procedures
- and functions that can use data declared in
- a program module.
- Data declared in a member module can be used
- only by its own procedure or function.
- This is Compiler's base window. The Source
- File field has been filled in for us with the
- name of the program module generated for the
- PHONES application (PHONES.CLA).
- We will compile this module and we will
- request a listing. The listing will be
- written to a file named PHONES.LST.
- Using Editor, we have introduced errors
- into PHONES1.CLA. Let's compile it
- and see what happens.
- This is the Compiler Errors window. To correct
- the errors, press the Esc key. Editor will then
- be executed. Editor will load the module, scroll
- to the first error, and display an error message.
- But we are getting ahead of ourselves.
- This completes the Compiler tutorial. The
- Processor tutorial should be viewed next.
- The CLARION Debugger
- Stopped for:Ctrl-Break
- Stopped at :PHONES2/GET_PHONE/34
- (Ctrl-S for Source)
- Called from:PHONES1/SHOW_PHONES/78
- (Ctrl-F for Source)
- Memory left:118K
- (Ctrl-X to execute)
- Trace
- DISPLAY
- DUMP
- Jump to :
- (26 thru 63)
- Break at:
- Variables
- Press Ctrl-Enter to resume or Ctrl-Break to exit
- Press Ctrl-P to peek then any key to debug
- This is the Clarion Debugger window.
- The top section of the window gives
- the current program status.
- The program was stopped because we
- pressed Ctrl_Break. A program will
- also stop for a STOP statement in
- the program or a break point set by
- the Debugger window.
- When we pressed Ctrl-Break, the program was
- executing statement number 34 in the GET_PHONE
- procedure. GET_PHONE was called from statement
- number 78 in the SHOW_PHONE procedure. There
- was 118K of memory that was not being used.
- Let's press Ctrl-S to see where the program
- stopped.
- We can trace a program by recording every statement
- number that was executed. STEP displays this trace
- window every time the program branches. DISPLAY
- displays the trace window each time it fills with
- statement numbers. And DUMP writes the statement
- numbers to a disk file.
- We can "jump" to a different statement in GET_PHONE
- by entering a statement number and resuming program
- execution. (Statement numbers 26 thru 63 are the
- only executable statements in GET_PHONE.) And we
- can set break points at any statement number in any
- procedure.
- We can watch or set the value of variables.
- Just enter a variable name and, optionally;
- a new value.
- The Debugger remembers your watch variables
- and displays them every step or break point.
- Pressing Ctrl-Break from the Debugger terminates
- the program. Ctrl-P temporarily removes the
- Debugger window so you can see "behind" it. The
- next keystroke restores the Debugger window.
- We will press Ctrl-Enter to resume the program.
- This completes the Processor Tutorial.
- The Translator tutorial should be viewed next.
- Update Directory
- Name
- Address
- City State:
- Zip
- Telephone :
- Update Directory
- Name
- :Kemp, Kim
- Address
- :56 Plum Ave
- City State:Miami, Fl
- Zip
- :33050
- Telephone :491-5856
- There is nothing in our PHONEBK file, so
- PHONES "pops up" the form window for us
- to make the first entry.
- Phone Directory
- Update Directory
- Print Directory
- Quit
- This is the menu screen we designed.
- The up and down arrow keys move the
- selector bar. (So do the "U", "P"
- and "Q" keys.)
- This is what we get if we press F1 (Help).
- Let's take a look at "Update Directory".
- 29 LOOP
- )!LOOP THRU AL
- ALERT
- &!TURN OFF THE
- ALERT(ACCEPT_KEY)
- !ALERT ON SCR
- ALERT(REJECT_KEY)
- !ALERT ON SCR
- ACCEPT
- %!GET THE NEXT
- IF KEYCODE() = REJECT_KEY THEN RETURN.
- !RETURN ON SC
- EDIT_RANGE# = FIELD
- !SET ONE FIEL
- IF KEYCODE() = ACCEPT_KEY
- !ON SCREEN AC
- UPDATE
- #! MOVE FIELD
- EDIT_RANGE# = ?LAST_FIELD
- AND EDIT
- LOOP FIELD# = FIELD() TO EDIT_RANGE#
- !EDIT FIELDS
- CASE FIELD#
- !JUMP TO FIEL
- OF ?FIRST_FIELD
- !FROM THE FIR
- IF KEY_CODE() = ESC_KEY THEN RETURN.
- ! RETURN ON
- OF ?PHN:NAME
- !Name
- OF ?PHN:ADDRESS
- !Address
- OF ?PHN:CITY_STATE
- !City and Sta
- OF ?PHN:ZIP
- !Zip Code
- OF ?PHN:PHONE
- !Telephone Nu
- !!LOOP THRU ALL THE FIELDS
- !!TURN OFF THE ALERT KEYS
- PT_KEY)
- !ALERT ON SCREEN ACCEPT
- CT_KEY)
- !ALERT ON SCREEN REJECT
- !!GET THE NEXT FIELD
- () = REJECT_KEY THEN RETURN.
- !RETURN ON SCREEN REJECT KEY
- # = FIELD
- !SET ONE FIELD EDIT RANGE
- () = ACCEPT_KEY
- !ON SCREEN ACCEPT
- !! MOVE FIELDS FROM SCREEN
- GE# = ?LAST_FIELD
- AND EDIT THE REST OF THEM
- To see more source code, we can
- scroll forward with the PgDn key.
- Or backward with the PgUp key.
- We can scroll horizontally to the
- right with the End key.
- And back to the left with the Home key.
- We press Esc to remove the source window.
- The CLARION Processor
- Program:C:\PHONES\PHONES.PRO
- This is the the Processor tutorial. It should
- be viewed after the Compiler tutorial.
- The Compiler tutorial compiled source programs
- generated by the Designer tutorial. Compiler
- produces a processor module for each source
- module it compiles. For PHONES, the Compiler
- tutorial produced PHONES.PRO and PHONES1.PRO
- through PHONES6.PRO.
- The processor modules contain Clarion pseudo
- code--the language of an imaginary Clarion
- computer.
- Processor loads all the processor modules for
- a program and executes them. The benefits of
- using the Processor are testing without
- linking and interpretive debugging.
- This is the Processor's base window.
- If Processor were invoked by Shift-F7 or Shift-F8,
- it would start execution without stopping here.
- To test PHONES, we press the Enter key.
- SCLARION CROSS REFERENCE v2.0 :PHONES.PRO
- 12/02/87 10:55AM
- VGLOBAL STRUCTURES AND VARIABLES
- $PAGE 1
- VPRE LABEL
- SIZE LINE REFERENCES
- VPHN: ADDRESS
- STRING
- 36 PHONES3
- PHN: CITY_STATE
- STRING
- 37 PHONES3
- PHN: NAME
- STRING
- 35 PHONES
- CPHONES2
- CPHONES3
- PHN: NAME_KEY
- 33 PHONES2
- 49 53 75 80 89 92
- /PHONES3
- PHN: PHONE
- DECIMAL
- 39 PHONES2
- CPHONES3
- PHONEBK
- 32 PHONES
- CPHONES2
- 34 47 48 55 79 87
- >88 93 94
- PHN: RECORD
- RECORD
- 34 PHONES
- CPHONES2
- 43 60 83
- PHN: ZIP
- 38 PHONES3
- SCLARION CROSS REFERENCE v2.0 :PHONES.PRO
- 12/02/87 10:55AM
- VPROCEDURES AND FUNCTIONS
- +PAGE 2
- VLABEL
- MODULE
- LINE REFERENCES
- VCHECK_PHONES PROCEDURE
- PHONES4
- 2 PHONES
- DPHONES1
- GET_PHONE
- PROCEDURE
- PHONES3
- 2 PHONES
- DPHONES2
- 44 76 84
- PROCEDURE
- PHONES1
- 2 PHONES
- 13 46
- PHONES
- PROCEDURE
- PHONES
- PRINT_PHONES PROCEDURE
- PHONES5
- 2 PHONES
- DPHONES4
- SCROLL_SCR
- PROCEDURE
- PHONES6
- 2 PHONES
- DPHONES2
- 50 96
- SHOW_PHONES PROCEDURE
- PHONES2
- 2 PHONES
- DPHONES1
- This is the first section of the cross-reference
- listing for PHONES. It lists global structures
- and variables in alphabetical order. the only
- global data in PHONES is the PHONEBK file. The
- "REFERENCES" are modules and line numbers where
- the labels are used.
- This section of the cross-reference shows all
- the procedures and functions in the program--
- where they occur and where they are called.
- This completes the Crossrefer tutorial.
- Let's return to the tutorial menu.
- The CLARION Compiler
- Stream Compilation Request
- Program
- :PHONES.PRO
- Listings
- Yes No
- Conditional:Yes
- Yes No
- NO MESSAGES FOUND IN PHONES.CLA
- After compiling a program module, Compiler offers to
- compile all member modules. This process is called
- stream compilation. Stream compilation is a fast way
- to compile modules for the first time or whenever
- global data in a program module is changed.
- A conditional stream compilation compiles all
- member modules if the global data has changed.
- Otherwise, it only compiles the member modules
- that have been changed.
- We will request a conditional stream
- compilation with listings.
- Our PHONES application is now compiled and ready for testing.
- Of course there were no errors--Designer is a fine programmer.
- If Compiler were executed by Shift-F7 (compile and test),
- Processor would load and execute without stopping here.
- But let's see what happens when Compiler finds errors.
- Stream Compilation Summary
- NO MESSAGES FOUND IN PHONES.CLA
- 4 MESSAGES FOUND IN PHONES1.CLA
- NO MESSAGES FOUND IN PHONES2.CLA
- NO MESSAGES FOUND IN PHONES3.CLA
- NO MESSAGES FOUND IN PHONES4.CLA
- NO MESSAGES FOUND IN PHONES5.CLA
- NO MESSAGES FOUND IN PHONES6.CLA
- Press Esc to correct errors
- Press Enter to continue
- RPHONES6.CLA
- End of compile
- 154k Available memory
- Ahlstrom, Kim
- 482-4766 Barrington, Bruce
- 784-6822 Cohen, Rob
- 491-5479 Dyer, Jackie
- 793-5847 Frankel, Allyn
- 791-5833 Garneau, Bob
- 492-5441 Garrett, Tom
- 395-8774 Hammond, Brian
- 782-8221 Herron, John
- 495-2876 Jackson, Tony
- 394-6887 Johnson, Don
- 493-5877 Kemp, Kim
- 491-5856 Kemp, Steve
- 468-2588 Kohler, Sue
- 941-5875 Lavella, Jim
- 941-5766 Liming, Gary
- 783-5113
- Phone Directory
- Herron, John
- 495-2876 Jackson, Tony
- 394-6887 Johnson, Don
- 493-5877 Kemp, Kim
- 491-5856 Kemp, Steve
- 468-2588 Kohler, Sue
- 941-5875 Lavella, Jim
- 941-5766 Liming, Gary
- 783-5113 Maibach, Tom
- 492-7536 Mitchell, Steve
- 395-2114 Nicholson, Ron
- 946-2117 Packer, Colvin
- 693-5874 Shaw, Monty
- 791-6587 Smith, LeAnn
- 492-5788 Steinke, Bob
- 395-2877 Wood, Dotti
- 782-5877
- Phone Directory
- Ahlstrom, Kim
- 482-4766
- Barrington, Bruce
- 784-6822
- Cohen, Rob
- 491-5479
- Dyer, Jackie
- 793-5847
- Frankel, Allyn
- 791-5833
- Garneau, Bob
- 492-5441
- Garrett, Tom
- 395-8774
- Hammond, Brian
- 782-8221
- Herron, John
- 495-2876
- Jackson, Tony
- 394-6887
- Johnson, Don
- 493-5877
- Kemp, Kim
- 491-5856
- Kemp, Steve
- 468-2588
- Kohler, Sue
- 941-5875
- LeAnn Smith
- 941-5766
- Liming, Gary
- 783-5113
- Now our phone directory has an entry in it.
- After we add a few more, it looks like this.
- The up and down arrow keys
- move the selector bar.
- From the bottom, down arrow
- scrolls the whole table up.
- Ctrl-PgDn scrolls to the
- end of the directory.
- And Ctrl-PgUp scrolls back
- back to the beginning.
- To change an entry, select
- it and press the Enter key.
- To add a new entry,
- press the Ins key.
- And to delete an entry,
- press the Del key.
- That's how our phone directory works--not bad for
- 15 minutes worth of design and no programming.
- Now let's take a look at the Processor's Debugger
- window. We will bring up the update window (with
- Enter) and then press Ctrl-Break.
- The CLARION Translator
- Program
- :C:\CLARION\PHONES.PRO
- Create ARF :No
- RTLink Link Plink86 No
- ARF Filename:
- ARF Switches:
- Use RTL File:No
- Yes No
- RTL Name
- Run Linker :No
- Yes No
- Linker Name :
- Line Numbers:No
- Yes No
- ;294k Available memory
- This is the Translator tutorial. It should be
- viewed after the Processor tutorial.
- The Compiler tutorial compiled the source program
- generated by the Designer tutorial. The Processor
- tutorial then tested that program by executing the
- .PRO modules produced by the Compiler.
- Translator reads each .PRO module for a program
- and creates a standard .OBJ module.
- Translator then produces an automatic response
- file (ARF) for either LINK or PLINK. (PLINK is
- the brand name of a linker utility copyrighted
- by Phoenix Software Associates, LTD.)
- If requested, Translator executes LINK or PLINK
- and produces a .EXE file which can be executed
- from the DOS command line.
- This is Translator's base window.
- The options entered here are saved
- in a file named PHONES.TRN. When
- Translator is invoked by Shift-F9,
- it uses the existing .TRN file and
- begins translating modules without
- stopping for operator entry.
- When the program is entered, the .TRN file is
- read and the options are displayed.
- This is the first translation for PHONES, so it
- has no .TRN file. These are default options.
- An Automatic Response File (ARF) is a text file which can be used to tell the
- linker the information it needs in order to link your program. Among other
- things, the ARF tells the linker the names of all of the modules that make
- up a program. Translator supports three styles of ARF -- Rtlink, Link, and
- Plink86. We will use a Link-style ARF.
- If we had chosen to use RtLink, we would be given the option useing an RTL or
- Run Time Library. Using this option will save disk space because multiple
- executable files can use the same RTL.
- We will accept PHONES.ARF as a filename.
- And, this time, we don't need special Link switches.
- We want to run the linker.
- It is in the \DOS directory.
- And we don't want line numbers.
- Microsoft Link is running now. It runs a long
- time--that's why we use Processor for testing.
- But let's not wait it out. Here's what happens
- when it finishes.
- We have just created a .EXE file for PHONES. This file can now
- be distributed without royalties and the end-user does not need
- to purchase a copy of Clarion.
- This completes the Translator tutorial and the tutorial series.
- Any remaining tutorial can be viewed next.
- The CLARION Crossrefer
- Program:C:\PHONES\PHONES.PRO
- This is the Crossrefer Tutorial.
- Crossrefer builds a cross-reference listing of the
- global data in a program. The listing shows where
- a label is declared and every place it is used.
- This is Crossrefer's base window. To build a
- a cross-reference listing for PHONES, we press
- the Enter key.
- The cross-reference listing is now
- contained in a file named PHONES.XRF.
- CERR
- CMP
- CMP_W1
- CMP_W2 -
- CMP_W3
- CMP_W4
- CMP_W5
- CMP_W6 O
- CMP_W7
- CMP_W8
- DBUG
- DBUG_W1
- DBUG_W2 \
- DBUG_W3 ;
- DBUG_W4
- DBUG_W5
- DBUG_W6 G
- DBUG_W7 G
- DBUG_W8 y
- FORM_ADD
- FORM_UPD
- FORM_W1
- MENU j
- MENU_W1
- MENU_W2 Q
- MENU_W3
- PGM1
- PGM2 g
- PGM3
- PGM_W1
- PGM_W2
- PGM_W3
- PGM_W4 3%
- PGM_W5
- PRO
- PRO_W1 D'
- PRO_W2
- PRO_W3 ?*
- RPT1 5+
- RPT2
- RPT_W1
- RPT_W2
- RPT_W3
- SCMP 03
- SCMP_W1 (5
- SCMP_W2 e6
- SCMP_W3 A7
- SCMP_W4
- SCMP_W5
- SERR 29
- TBL_BGN
- TBL_EMPT
- TBL_END
- TBL_FULL
- TBL_W1
- TBL_W2
- TBL_W3
- TBL_W4 SF
- TBL_W5
- TBL_W6
- TBL_W7 kG
- TBL_W8
- TBL_W9
- TRN :I
- TRN_W1 ,M
- TRN_W2
- TRN_W3 eP
- TRN_W4
- TRN_W5
- TRN_W6 jU
- TRN_W7
- TRN_W8
- XRF (X
- XRF_W1
- XRF_W2
- XRF_W3 I[
-